<?php
/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2017/8/16
 * Time: 10:02
 */

namespace app\content\controller;

use think\Controller;
use think\Db;

class Index extends Controller
{
    public function index()
    {
        Db::connect();
        $result = Db::table("content")
            ->alias("c")
            ->join("question q", "c.id=q.contentId")
            ->where("id",2)
            ->limit(2)
            ->select();
        /*var_dump($result);*/

        $hello = "hello world";
        $this->view->assign("hello", $hello);
        $this->view->assign("data", $result);
        return $this->view->fetch();
    }
}